import os,sys
filename=sys.path[0]+'\\test.txt'
#print filename
for line in range(30):
    newFileName=filename+str(line);
    name, ext = os.path.splitext(newFileName)
    name=name+str(line)
    print name
    #print os.path.dirname(newFileName)
    #print os.path.basename(newFileName)
    f=open(name,'w')
    f.write('abc')
    f.close()